package com.zhengxiang.onlinexamination.controller;

import com.zhengxiang.onlinexamination.base.AjaxResult;
import com.zhengxiang.onlinexamination.entity.vo.ExamPaperVo;
import com.zhengxiang.onlinexamination.service.ExamPaperService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 试卷(PublicExamPaper)表控制层
 *
 * @author
 * @since 2023-03-13 11:50:36
 */
@RestController
@RequestMapping("publicExamPaper")
public class ExamPaperController {
    /**
     * 服务对象
     */
    @Resource
    private ExamPaperService examPaperService;

    /**
     * 试卷列表
     * @param publicExamPaperTo
     * @return
     */
    @PostMapping("queryAll")
    public AjaxResult queryAll(@RequestBody ExamPaperVo publicExamPaperTo) {
        return AjaxResult.success(examPaperService.queryAll(publicExamPaperTo));
    }

    /**
     * 新增试卷
     * @param publicExamPaperTo
     * @return
     */
    @PostMapping("savePaper")
    public AjaxResult savePaper(@RequestBody ExamPaperVo publicExamPaperTo){
        examPaperService.savePaper(publicExamPaperTo);
        return AjaxResult.success();
    }



}

